<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>自用—合格证打印页去除顶部按钮快速打印</title>
  </head>
  <style type="text/css">
    *{
      -webkit-user-select: auto;
    }
  </style>
 
  <body>
    <span id="content">
	<TEXTAREA rows="5" wrap="off" name="code" style="width: 600px; height: 250px; font-size: 11px" onclick="select()">
// ==UserScript==
// @name         自用—合格证打印页去除顶部按钮
// @namespace    http://vige_1_vipgreatking.gitee.io/javascript
// @version      1.0
// @description  try to take over the world!
// @author       vige
// @include      http://222.172.224.41:8001/baseInfo/businesss/Print?*
// @match
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    $("button").remove();
    console.log('移除顶部“打印”、“关闭”功能按钮');
    setTimeout( "onPrint()",1 * 1000 );//延迟3000毫秒打印当前页
})();

    </TEXTAREA>
<!--  <br> // ==UserScript==</br> 
 <br> // @name         自用—合格证打印页去除顶部按钮</br> 
 <br> // @namespace    http://vige_1_vipgreatking.gitee.io/javascript</br> 
 <br> // @version      0.1</br> 
 <br> // @description  try to take over the world!</br> 
 <br> // @author       vige</br> 
 <br> // @include      http://222.172.224.41:8001/baseInfo/businesss/Print?*</br> 
 <br> // @match</br> 
 <br> // @grant        none</br> 
 <br> // ==/UserScript==</br> 

 <br> (function() {</br> 
    <br>  'use strict';</br> 
   <br>   $("button").remove();</br> 
   <br>   console.log('移除顶部“打印”、“关闭”功能按钮');</br> 
   <br>    onPrint()</br> 
 <br> })(); </br>  -->
    </span>
    <button id="copyBT">复制</button>
    <script>
      function copyArticle(event) {
        const range = document.createRange();
        range.selectNode(document.getElementById('content'));
 
        const selection = window.getSelection();
        if(selection.rangeCount > 0) selection.removeAllRanges();
        selection.addRange(range);
        document.execCommand('copy');
        alert("复制成功！");
      }
 
      document.getElementById('copyBT').addEventListener('click', copyArticle, false);
    </script>
  </body>
 
</html>